package com.lyx.server.redisson;

import org.redisson.Redisson;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;

/**
 * --- Be Humble and Hungry ---
 *
 * @author McMeloxD
 * @date 2024/8/14
 * @desc Redisson工具类
 */
public class RedissonUtil {
    private static RedissonClient client;
    static {
        Config config=new Config();
        config.useSingleServer().setAddress("redis://101.201.70.137:6379").setPassword("60669");
        client= Redisson.create(config);
    }

    /**
     * 分布式锁*/
    public static RLock getLock(String key){
        return client.getLock(key);
    }
}
